package com.dgut.springsecurity.Details;

import com.dgut.adminmanager.entity.Administrator;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

public class AdminDetail extends User {

    private Integer administratorId;
    private String power;
    public AdminDetail(Administrator administrator, Collection<? extends GrantedAuthority> authorities){
        super(administrator.getAccount(),administrator.getPassword(),authorities);
        this.administratorId=administrator.getId();
        this.power=administrator.getPower();
    }
    public AdminDetail(Administrator administrator,boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities){
        super(administrator.getAccount(),administrator.getPassword(),enabled,accountNonExpired,credentialsNonExpired,accountNonLocked,authorities);
        this.administratorId=administrator.getId();
        this.power=administrator.getPower();
    }

    public Integer getAdministratorId() {
        return administratorId;
    }

    public void setAdministratorId(Integer administratorId) {
        this.administratorId = administratorId;
    }

    public String getPower() {
        return power;
    }

    public void setPower(String power) {
        this.power = power;
    }
}
